<template>
  <div class="hello">
    <button @click="getBtnClick">发起get请求</button>
    <button @click="postBtnClick">发起post请求</button>
  </div>
</template>

<script>
export default {
  methods:{
    getBtnClick:function(){
      this.$http.get("/api/get",{
        params:{
          name:"sun",
          age:23
        }
      })
      .then(res=>{
        console.dir(res);
      });
    },
    postBtnClick:function(){
      this.$http.post("/api/post",{
        params:{
          name:"sun",
          age:23
        }
      })
      .then(res=>{
        console.dir(res);
      });
    }
  },
  data () {
    return {
      
    }
  },
  mounted:function(){
    console.log('页面加载完成');
  },
  
}
</script>

<style scoped lang="scss">
  @import '../../static/css/hello.scss';
  @import '../../static/css/hello.css';
</style>
